package com.wiscamp.ninechapters.problems.application.dto.vo.sets;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.wiscamp.ninechapters.ddd.ViewObject;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collection;

/**
 * 习题集
 */
@Data
public class ProblemSetVO implements ViewObject {
    /**
     * 习题集编号
     */
    private long setId = 0;

    /**
     * 习题集代码
     */
    private String setCode = "";

    /**
     * 习题集名称
     */
    private String setName = "";

    /**
     * 习题集类型编号
     */
    private int setTypeId = 0;

    /**
     * 规则编号
     */
    private long ruleId = 0;

    /**
     * 机构编号
     */
    private long organizationId;

    /**
     * 学科编号
     */
    private long subjectId = 0;

    /**
     * 总题数
     */
    private int problemQuantity = 0;


    /**
     * 题分数
     * 为所有辖题的总分数，每题分数为难度值整除10，最低分数为1
     */
    private int totalScore = 0;

    /**
     * 答题时限
     * 每题做题时间为5分钟，总题数乘5
     */
    private int totalTimeLimit = 0;

    /**
     * 是否真题
     */
    private boolean trueProblem = false;

    /**
     * 难度值
     * 所有辖题的平均难度值
     */
    private int difficulty = 0;

    /**
     * 备注
     */
    private String remark = "";

    /**
     * 是否可用
     */
    private boolean enabled = true;

    /**
     * 创建用户
     */
    private long creatorId = 0;

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime creationTime;

    /**
     * 编辑用户
     */
    private long modifierId = 0;

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime modificationTime;

    /**
     * 习题集中的题列表
     */
    private Collection<SetProblemVO> setProblems = new ArrayList<>();
}